1. Field of the Invention
The present invention relates to a numerically controlled machine tool and specifically to a numerically controlled machine tool which allows a machining program to be re-executed easily after it has been stopped and which allows the machining program to be checked easily, thereby speeding up miscellaneous function processing.
2. Description of the Background Art
In recent years, machine tools using computer numerical control apparatuses with built-in computers (numerically controlled machine tools) have found widespread use in machining fields, pushing automation and labor-saving forward in these fields.
A numerically controlled machine tool consists of a computer numerical control apparatus (CNC), a power sequence circuit and a machine tool.
The power sequence circuit, which is provided between the CNC and the machine tool to do a variety of miscellaneous tasks, was ordinarily made of 200 to 300 relay circuits in the conventional art depending on a machine scale. As NC shifted from wiring logic NC to CNC, the mainstream of the power sequence circuit has changed from a relay circuit to a programmable controller (PC) using a microprocessor.
The PC is classified as either a general-purpose PC or a built-in PC dedicated to CNC. While the general-purpose PC is used with a machine tool which has several hundred tools and an auto loader and requires intricate sequences and I/O signals, the built-in PC is functional enough to be used with most machine tools.
The built-in PC for use with a lathe or a compact machining center can exhibit PC functions by utilizing the remaining capacity of a microprocessor for CNC, without an independent microprocessor being specifically prepared for the PC. In this case, the number of parts for use with the PC may be extremely small, whereby the PC achieved is excellent in both reliability and cost.
The built-in PC for use in the CNC, which can be contained in the locker of the CNC, also has an advantage that a space for installation of the PC is not required in the machine.
Data transfer between the built-in PC and the CNC is made by a common bus (or equivalent) without special drivers/receivers being required, whereby the number of I/O points required for the PC is about half that of the general-purpose PC.
Various settings (such as those of timers and counters), status display, alarm message display, etc., related to the PC can be made from the operator panel of the CNC and do not require any other operator panel. FIG. 26 is a schematic diagram of a CNC machine tool using a CNC having a built-in PC dedicated to an NC, wherein the numeral 10 indicates a CNC and 20 denotes a machine tool. The CNC 10 consists of an NC 1, a programmable controller (PC) 2 and an input/output circuit 3, and the NC 1 is made up of a man-machine controller 4 controlled by a man-machine interface between an operator 110 and the CNC machine tool, a miscellaneous command controller 5 for controlling miscellaneous commands such as M, S and T commands, and an axis movement controller 6 for controlling servo axes.
The PC 2, which stores sequence programs, is a sequence control apparatus having a structure (not shown) similar to that of a computer and consists of a CPU, a program storage device, etc., mainly semiconductor memories such as ROMs and RAMS. The I/O circuit 3 is an interface with the machine, consists of drivers and receivers, and is connected to a machine operation panel 12, a power circuit 13, a spindle amplifier 15, etc., of the machine tool 20.
The machine tool 20 has an NC operation panel 11, which acts as the center of a man-machine interface between the operator 110 and the CNC machine tool and which generally consists of a CRT device, a ten-key pad, etc. The data of the NC 1 is displayed on the CRT device and data is entered from the ten-key pad.
The machine operation panel 12 is mainly employed by the operator 110 to manually operate the machine tool, the power circuit 13 controls the actuators, etc., of machine components 14, the spindle amplifier 15 controls a spindle motor 16, and a velocity control unit 17 controls a feed motor 18.
In addition to its essential task, i.e., machining such as cutting and grinding, the machine tool has auxiliary tasks to carry out said machining, for example, workpiece loading/unloading, spindle motor start/stop, cutting oil on/off, and tool selection.
These auxiliary tasks are processed by the PC 2 in response to miscellaneous function signals (M commands), tool select signals (T commands), etc., transmitted from the NC 1.
FIG. 27 illustrates a miscellaneous function signal interface, wherein any of two-digit BCD code signals (M11 to M24) and a code reading signal (MF) are transmitted from the NC 1 to the PC 2, this code signal is decoded by the PC 2, required actuators are driven in a predetermined sequence, and operations commanded are performed.
When the operations are complete, a completion signal (FIN) is sent to the NC 1. Receiving the FIN signal, the NC 1 switches off the code reading signal MF. Subsequently, the NC 1 switches the completion signal FIN off, then the M code signal off, and the processing progresses to an NC command in a next block. The timing chart of this operation is shown in FIG. 28.
FIG. 29 is a flowchart showing a sequence of operations from the creation of a machining program to the inspection of a workpiece. While simultaneously looking at a machining drawing 100, a programmer 101 writes an NC machining program (step 102). The machining program is written in a general EIA format, a CNC-loaded automatic program often used recently, offline CAM or the like. 103 indicates an NC machining program written as described above.
When the creation of the machining program is complete, the machining program 103 is checked (step 104). This check can be performed by displaying the locus of a machining path on a screen since many of recent CNCs are capable of graphic display, etc. When the machining program 103 seems to be correct, the machine tool is operated without actual machining being carried out, thereby performing a non-cutting operation in which the machining program is checked while simultaneously the operation of the machine tool is confirmed (step 105). If cutting seems to be done without fault, trial machining is carried out actually (step 106). If correct cutting seems to be performed, a regular cutting operation is started (step 107) and a workpiece is inspected as required (step 108). If a machining program fault has been found in any stage of steps 104 to 108, the machining program 103 is corrected (step 109), and rechecked from the required stage of steps 104 to 108. In the stage of said steps 105, 106 and 107, it may be necessary for the operator 110 to temporarily stop the execution of the machining program and perform a manual operation.
For example, the operator 110 may need to remove chips caught during cutting by performing manual operation, or needs to change a tool broken midway during operation.
FIG. 30 illustrates the internal statuses of the NC 1 and the machine tool 20 at a time when the execution of the machining program has been stopped and interruption made by manual operation, etc.
Concurrently with the analysis of the NC machining program 103 (step 111), the NC 1 outputs various commands to the machine. In response to the commands, the machine tool 20 performs predetermined operations (step 114). At this time, status A of the NC 1 matches status A of the machine tool 20. A status match in this case indicates that the status of the machine tool 20 recognized by the NC 1 matches the actual status of the machine tool 20, e.g., when the NC 1 recognizes that tool No. 7 is currently fitted to the machine tool 20, the machine tool 20 is actually fitted with tool No. 7. Further, the position of each axis of the machine tool 20 recognized by the NC 1 matches the actual position of each axis of the machine tool 20.
Machining is generally executed in accordance with the machining program 103 during the execution of the machining program 103, with the statuses of both the NC 1 and the 10 machine tool 20 matching as described above. When this execution is stopped (step 112) and the operator 110 operates the machine tool through manual operation or the like (step 113), NC status B at a stop is different from machine tool status B and NC status C after an interrupt operation is different from machine tool status C, respectively.
FIG. 31 illustrates an example of the above operation. During the execution of the machining program (107), assume that an M08 command is given. Since the M08 command is a liquid coolant ON command, liquid coolant is set to the ON status in the machine tool. This liquid coolant remains in the ON status until coolant OFF (M09 command) is provided. Supposing that the machining program is stopped in this stage (112), the execution of the machining program is stopped but the liquid coolant in the machine tool remains ON. Since it is difficult for the operator 110 to perform operation if the coolant remains ON, the operator 110 gives the M09 command by manual operation (MDI) to switch the coolant OFF (113). Receiving this M09 command, the machine tool set the coolant to the OFF status. If it is attempted to resume the machining program subsequently (118), machining will be resumed in the machine tool with the coolant remaining in the OFF status, and machining will be resumed in a status different from the stop-time status, i.e., the liquid coolant ON status.
In addition to the above example which is related to miscellaneous commands, if a tool must be moved from a stop-time tool position to enable operation, moving the tool will naturally render the tool position at the stop time (112) different from the tool position after interrupt operation (113).
FIG. 32 illustrates an operation wherein the NC machining program 103 stopped is resumed. When the NC machining program 103 is stopped once and the interrupt operation 113 is performed, the NC and machine tool statuses become different after the stop, and if the NC machining program 103 is resumed in those statuses, machining cannot be carried out without fault. For this reason, a restoring operation 117 required for resumption must be conducted. The restoring operation indicates that the machine position is returned to the stop-time position and the machine status is returned to the stop-time status (spindle rotation, coolant ON/OFF, etc.).
When the machining program is stopped to a temporary machining program stop status, e.g., a feed hold or a block stop, and is then resumed in such a status, there is no problem. However, if the execution of the machining program has been stopped completely by, for example, resetting the CNC and is then to be resumed, a function, such as a program search for finding only the position of the machining program or a modal search for finding the position of the machining program concurrently with the updating of the internal status of the CNC, must be employed to return the machining program to its beginning.
FIG. 33A shows an example of an automatic tool changer (ATC). 30 indicates an ATC stored with a plurality of replacement tools 35, 36. As also seen in FIG. 33B, 32 denotes a tool changing arm having hands 33 at both ends for gripping tools. 31 represents a spindle fitted with a machining tool 34 at a front end for machining a workpiece with said tool 34. When a tool change is made, first the replacement tool is moved to the tool changing position of the ATC 30 and the machining tool 34 is then moved to the tool changing position. This is a position where the arms 32 can change tools and is predetermined for the machine. When the machining tool 34 and the replacement tool 35 have reached the predetermined positions, a miscellaneous command for tool change (M06) is executed.
FIG. 34 is a flowchart which indicates correspondences between a series of machine operations under the command of M06 (tool change) and miscellaneous commands (M commands) corresponding to said machine operations. When M06 is executed, a tool change is completed by a series of operations as shown in FIG. 34. During the tool changing operation performed by specifying M06, some fault may take place, resulting in a failure to continue the tool changing operation. In this case, since the operator 110 must intervene to remove the fault and complete the tool change, it is general that each operation of the series of operations for tool change can be specified by a miscellaneous command (M command). Namely, it is designed to allow the operations equivalent to the M06 command to be performed by giving M601 to M612 in sequence.
Suppose that the ATC arm has been disabled from swinging due to interference with the workpiece or the like during xe2x80x9c180xc2x0 arm swingxe2x80x9d, an operation equivalent to M606 in FIG. 34. In this case, the NC machine tool cannot continue machining and the operator must intervene to remove the fault factor. For this purpose, the operator stopped the execution of the program, then removed the fault factor by manual operation, etc., observed the tool change condition to recognize that the stop had been effected during the xe2x80x9c180xc2x0 arm swingxe2x80x9d because the tool change operation (M06) had ended.midway during the operation, and executed the M606 to M612 commands which would command the subsequent series of tool change operations to be performed by manual operation (MDI), thereby completing M06 processing.
The conventional numerically controlled machine tool arranged as described above had a first disadvantage that after the machining program 103 was stopped for some reason and interrupt processing was performed, the operator 110 had to return from the current status to the stop-time status with great trouble and time for the resumption of the machining program 103, and if machining is resumed without the correct status being restored, the machine may be damaged.
To facilitate this machining program resumption processing, Japanese Laid-Open Patent Publication No. SHO55-97606 discloses an invention wherein, if the operator 110 has moved the machining stop-time tool position by manual operation, its midway or partway path is stored and this midway or partway path stored is traced reversely at the resumption time to restore the tool to the stop position.
Further, Japanese Laid-Open Patent Publication No. SHO57-60488 and Japanese Laid-Open Patent Publication No. HEI2-151909 disclose inventions wherein a stop-time CNC status is stored and this stored CNC status is restored at a resumption time to resume machining.
However, each of these two approaches merely stores the stop-time internal status of the CNC and simply restores it at the resumption time and does not give any consideration to a resumption-time machine status. Also, each of these three approaches has restrictions on the operation between the stop and resumption of machining in order to properly resume the machining. For instance, in the invention disclosed in Japanese Laid-Open Patent Publication No. SHO55-97606, a return is always allowed only to a stop position and data stored becomes invalid when the CNC is powered down.
Also, either of the approaches disclosed in Japanese Laid-Open Patent Publication No. SHO57-60488 and in Japanese Laid-Open Patent Publication No. HEI2-151909 allows only an interrupt program preprogrammed to interrupt at a machining stop time and does not permit the operator 110 to perform an interrupt operation optionally.
As a concept which considers a resumption time for miscellaneous commands, such as M commands, there is an approach which stores miscellaneous commands executed previously and displays their data on a screen at a resumption time to assist the operator 110 in performing resumption processing, as disclosed in Japanese Laid-Open Utility Model Publication No. SHO57-78407.
Also,. there is an approach that groups miscellaneous commands and displays which miscellaneous command is the one given last in each group to assist the operator 110 in writing a resumption processing program, as disclosed in Japanese Laid-Open Patent Publication No. SHO63-73401.
Further, there is an approach that groups miscellaneous commands and automatically executes the finally given miscellaneous command in each group at a resumption processing time to resume machining, as disclosed in Japanese Laid-Open Patent Publication No. HEI2-300801.
However, any of these three approaches merely updates data during the search or execution of a machining program and does not allow the resumption-time status of the machine tool to be obtained if the stop-time CNC miscellaneous command status can be obtained.
Also, the conventional machine tool had a second disadvantage that it was difficult to obtain the machine status with the machine cover closed since the current machine status cannot be identified until the actual machine is viewed.
Also, when a complicatedly structured machining program having multi-level nesting was executed and then stopped during the execution of a subprogram, it was difficult to judge at which position the machining program stopped machining. Hence, the conventional machine tool had a third disadvantage that time and labor were required to specify the program position from where machining was to be resumed, giving a burden to the operator 110.
To solve this disadvantage, Japanese Laid-Open Patent Publication No. SHO62-32505 or Japanese Laid-Open Patent Publication No. HEI2-114302 discloses a technique which displays the execution position of a nested machining program. This Japanese Laid-Open Patent Publication No. SHO62-32505 also discloses that the specified number of subprogram repetition times and the number of repetition times during execution are displayed.
However, these two techniques allow the execution position of the machining program to be recognized but do not allow this recognized position of the machining program to be specified. When the machining program was stopped during the execution of the subprogram, it was impossible to specify that position, because the conventional method of specifying the position of the machining program did not allow the position of the main program which had called the subprogram, the number of executed repetition times, etc., to be specified.
To solve this disadvantage, Japanese Laid-Open Patent Publication No. SHO60-263209 discloses a system wherein a position in a subprogram and the number of executed repetition. times are specified and searched. However, since the position of a main program that had called the subprogram cannot be specified, this system has a disadvantage that if the main program had called the same subprogram at a plurality of positions, the calling positions from the second onward cannot be searched.
Further, the system disclosed in Japanese Laid-Open Patent Publication No. SHO60-263209 has a disadvantage that much search time is required since the repetition processing of the subprogram is executed intact to make a search.
Also, the known machine tools had a further disadvantage that if a fault occurred during a series of machine operations, such as a tool change, commanded to be performed by a single miscellaneous command, it was difficult to identify the operation where the fault had taken place and further a restoring operation was difficult.
Also, the known machine tool had a another disadvantage that machining time was lost because the program advanced to the next step after the completion of a miscellaneous command if it is the one that need not be completed.
To solve this disadvantage, there is a method wherein a next block is processed without waiting for the completion signal of an M command which need not be completed, as disclosed in Japanese Laid-Open Patent Publication No. SHO62-189506. However, if the next block is simply processed without waiting for the M command as disclosed in this publication, a fault will occur in the following case and the M command cannot be executed correctly.
Namely, when the next block is executed without waiting for the completion of the M command and another M command exists in the next block, the PC will ignore the next M command or a fault may occur in the PC if the next M command is output intact to the PC, because the PC is executing the preceding M command. Assuming that the interface with the PC remains unchanged from the previous one since the publication does not describe specifically that the interface with the PC is changed, the PC is not permitted to output the next M command during the processing of the preceding M command.
Also, the known machine tool had yet another disadvantage in that the machining program was not easy to check because selection could be made from only two methods, i.e., all miscellaneous commands are executed or all miscellaneous commands are not executed (miscellaneous command lock) for non-cutting operation or the like in which the machining program was checked concurrently with the operation of the machine tool.
Further, the known machine tool had a disadvantage in that when it was attempted to check the machining program concurrently with the actual movement of the machine, there was no function appropriate for checking the program with the slight movement of the machine at any area that the machine may interfere with.
Accordingly, an object of the present invention is to overcome certain of the several disadvantages previously noted by providing a numerically controlled machine tool which allows the automatic generation of a restoring program for carrying out processing required for the resumption of an NC machining program to resume the execution of the NC machining program after the execution of the NC machining program has been stopped and interrupt processing has been performed.
Specifically, in a numerically controlled machine tool embodying the present invention, when the machining program is re-executed from where it had stopped after the execution of the machining program has stopped and the operator has performed optional interrupt processing, the stop-time and re-execution-time machine statuses are compared to automatically generate the restoring program so that the machine status may be returned to the stop-time status, whereby the operator can perform the resumption processing of the machining program without any restrictions.
Further, the stop-time status of the NC machine tool can be displayed to allow the operator to easily grasp the stop-time status of the NC machine tool, and furthermore, this status can be corrected on the screen to significantly improve flexibility at the resumption time.
Also, the operator can correct the automatically generated restoring program as appropriate to enable optimum restoring processing according to stop-time and resumption-time conditions.
Also, the M commands given are classified into groups and the M commands specified for each group are monitored to allow the machine status to be recognized, and each M command can be annotated with a comment to allow the operator to grasp the machine status easily.
Further, the number of subprogram repetition times and the number of its execution times can be corrected and even the execution position of the program can be corrected as required, whereby control can be exercised as appropriate to start a complicatedly structured machining program having multiple nesting partway through a subprogram and partway through a plurality of repetitions.
Also, if the machine has stopped halfway through a series of machine operations, at which operation of the series of machine operations the machine has stopped can be recognized and the machine can be restored easily after the stop factor has been removed.
Another object of the invention is to overcome other of the above disadvantage by providing a numerically controlled machine tool which executes a next step without waiting for the completion of a miscellaneous command which need not be completed.
Specifically, the processing immediately shifts to a next command when an M command which need not be completed is being executed, whereby the processing of the M command which need not be completed can be performed at high speed.
Also, when the next M command has been specified, the M command is always output to the PC after the previously given M command is complete, whereby the machine is applicable without requiring the interface between the conventional NC and the PC to be changed.
A further object of invention also is to overcome other noted disadvantages by providing a numerically controlled machine tool which is not limited to execute only a specific miscellaneous command if it has been specified, thereby ensuring ease of machining program check. The invention also provides a numerically controlled machine tool which executes only a specific miscellaneous command even in a miscellaneous command lock status, thereby ensuring ease of machining program check.
Specifically, according to the numerically controlled machine tool of the present invention, the M commands which are not desired to be executed are allowed to be not executed without the machining program being modified, whereby the machining program can be checked on the actual machine safely and easily.
Also, the M commands which are desired to be executed even at the miscellaneous command lock time are allowed to be executed without the machining program being modified, whereby the machining program can be checked on the actual machine easily.
A further object of the invention is to provide a numerically controlled machine tool which allows a tool to move a specified distance on a tool path specified by a machining program and come to a stop every time a travel distance is specified.
Specifically, the numerically controlled machine tool concerned with the present invention, the tool can be moved by the specified travel distance and stopped to the feed hold status, whereby the machining program can be checked easily in relation to the movement of the tool. For example, if the tool is likely to interfere with a workpiece, a tailstock or the like, whether the tool interferes or not is checked by moving the tool little by little. In such a case, the travel of actual movement can be specified optionally, whereby the operator can make a check free from care.